package com.behelpful.common.integration.iredis.constants;

import com.behelpful.common.core.enums.IRedisCacheEnum;
import lombok.Getter;

/**
 * 验证码枚举
 *
 * @author Alay
 * @date 2021-09-24 11:33
 */
@Getter
public enum ValidateCodeEnum implements IRedisCacheEnum {

    /**
     * 登录验证码验证
     */
    LOGIN_VALIDATE("LOGIN_VALIDATE_", "LOGIN_VALIDATE_LIMIT", 14, 100, 120),
    /**
     * 通用验证
     */
    COMMON_VALIDATE("COMMON_VALIDATE_", "COMMON_CODE_LIMIT", 14, 100, 120),
    ;

    /**
     * 验证码的Key
     */
    private String key;
    /**
     * 验证码发送次数限制的Key
     */
    private String limitKey;
    /**
     * Redis的库索引位置
     */
    private int index;
    /**
     * 一天之内限定几次
     */
    private int limit;
    /**
     * 缓存时间（秒）
     */
    private int expireSecond;

    ValidateCodeEnum(String key, String limitKey, int index, int limit, int expireSecond) {
        this.key = key;
        this.limitKey = limitKey;
        this.index = index;
        this.limit = limit;
        this.expireSecond = expireSecond;
    }


}